home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_randamb.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  81 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_RandAmb.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        entered
  13.     message        startup
  14.  
  15.     thing        soundPos0        nolink
  16.     thing        soundPos1        nolink
  17.     thing        soundPos2        nolink
  18.     thing        soundPos3        nolink
  19.     
  20.     sector      on_sec1         linkID=1
  21.     sector      on_sec2         linkID=1
  22.     sector      on_sec3         linkID=1
  23.     sector      off_sec1        linkID=0
  24.     sector      off_sec2        linkID=0
  25.     sector      off_sec3        linkID=0
  26.  
  27.     sound        wav0=sol_ambient01_a.wav   local
  28.     sound        wav1=sol_ambient02_a.wav    local
  29.     sound        wav2=sol_ambient03_a.wav    local
  30.     sound        wav3=sol_ambient04_a.wav    local
  31.     sound        wav4=sol_ambient05_a.wav    local
  32.     sound        wav5=nub_ambient4_a.wav    local
  33.     
  34.     int            sndNum            local
  35.     int            numPos=4        local
  36.     int            count           local
  37.  
  38. end
  39.  
  40. # ========================================================================================
  41.  
  42. code
  43.  
  44. entered:
  45.  
  46.     if(GetSenderID() == 1)
  47.     {
  48.         #Print("ambients on");
  49.         setpulse(2.0);
  50.     }
  51.     
  52.     if(GetSenderID() == 0)
  53.     {
  54.         #Print("ambients off");
  55.         SetPulse(0.0);
  56.     }
  57.     return;
  58.  
  59. # ========================================================================================
  60.  
  61. pulse:
  62.  
  63.     SetPulse(0.0);
  64.     sndNum = RandBetween(0, 5);
  65.     
  66.     for (count = 0; count <= numPos; count = count+1) 
  67.     {
  68.         if (soundPos0[count] >= 0) 
  69.         {
  70.             PlaySoundThing(wav0[sndnum], soundPos0[count], 1.0, -1, -1, 0);
  71.         }
  72.     }
  73.     
  74.     SetPulse(2.0);
  75.     
  76.     return;
  77.  
  78. # ========================================================================================
  79.  
  80. end
  81.